package com.zhousb.deviceManager.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ScanStatusEnum {

    DEFAULT(-1, "默认"),
    CREATED(0,"未扫描"),
    SCANNED(1,"已扫描")
    ;
    private Integer code;
    private String name;

    public String getNameByCode(Integer code) {
        for (ScanStatusEnum _enum : ScanStatusEnum.values()) {
            if (_enum.getCode().equals(code)) {
                return _enum.getName();
            }
        }
        return DEFAULT.getName();
    }
}
